home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_emacs.idb / usr / freeware / info / emacs-5.z / emacs-5
Encoding:
GNU Info File  |  1998-10-28  |  45.0 KB  |  1,083 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Rectangles,  Next: Registers,  Prev: Accumulating Text,  Up: Top
  6.  
  7. Rectangles
  8. ==========
  9.  
  10.    The rectangle commands operate on rectangular areas of the text: all
  11. the characters between a certain pair of columns, in a certain range of
  12. lines. Commands are provided to kill rectangles, yank killed rectangles,
  13. clear them out, fill them with blanks or text, or delete them. Rectangle
  14. commands are useful with text in multicolumn formats, and for changing
  15. text into or out of such formats.
  16.  
  17.    When you must specify a rectangle for a command to work on, you do it
  18. by putting the mark at one corner and point at the opposite corner.  The
  19. rectangle thus specified is called the "region-rectangle" because you
  20. control it in about the same way the region is controlled.  But
  21. remember that a given combination of point and mark values can be
  22. interpreted either as a region or as a rectangle, depending on the
  23. command that uses them.
  24.  
  25.    If point and the mark are in the same column, the rectangle they
  26. delimit is empty.  If they are in the same line, the rectangle is one
  27. line high.  This asymmetry between lines and columns comes about
  28. because point (and likewise the mark) is between two columns, but within
  29. a line.
  30.  
  31. `C-x r k'
  32.      Kill the text of the region-rectangle, saving its contents as the
  33.      "last killed rectangle" (`kill-rectangle').
  34.  
  35. `C-x r d'
  36.      Delete the text of the region-rectangle (`delete-rectangle').
  37.  
  38. `C-x r y'
  39.      Yank the last killed rectangle with its upper left corner at point
  40.      (`yank-rectangle').
  41.  
  42. `C-x r o'
  43.      Insert blank space to fill the space of the region-rectangle
  44.      (`open-rectangle').  This pushes the previous contents of the
  45.      region-rectangle rightward.
  46.  
  47. `M-x clear-rectangle'
  48.      Clear the region-rectangle by replacing its contents with spaces.
  49.  
  50. `M-x string-rectangle RET STRING RET'
  51.      Insert STRING on each line of the region-rectangle.
  52.  
  53.    The rectangle operations fall into two classes: commands deleting and
  54. inserting rectangles, and commands for blank rectangles.
  55.  
  56.    There are two ways to get rid of the text in a rectangle: you can
  57. discard the text (delete it) or save it as the "last killed" rectangle.
  58. The commands for these two ways are `C-x r d' (`delete-rectangle') and
  59. `C-x r k' (`kill-rectangle').  In either case, the portion of each line
  60. that falls inside the rectangle's boundaries is deleted, causing
  61. following text (if any) on the line to move left into the gap.
  62.  
  63.    Note that "killing" a rectangle is not killing in the usual sense;
  64. the rectangle is not stored in the kill ring, but in a special place
  65. that can only record the most recent rectangle killed.  This is because
  66. yanking a rectangle is so different from yanking linear text that
  67. different yank commands have to be used and yank-popping is hard to
  68. make sense of.
  69.  
  70.    To yank the last killed rectangle, type `C-x r y'
  71. (`yank-rectangle').  Yanking a rectangle is the opposite of killing
  72. one.  Point specifies where to put the rectangle's upper left corner.
  73. The rectangle's first line is inserted there, the rectangle's second
  74. line is inserted at a position one line vertically down, and so on.  The
  75. number of lines affected is determined by the height of the saved
  76. rectangle.
  77.  
  78.    You can convert single-column lists into double-column lists using
  79. rectangle killing and yanking; kill the second half of the list as a
  80. rectangle and then yank it beside the first line of the list.  *Note
  81. Two-Column::, for another way to edit multi-column text.
  82.  
  83.    You can also copy rectangles into and out of registers with `C-x r r
  84. R' and `C-x r i R'.  *Note Rectangle Registers: RegRect.
  85.  
  86.    There are two commands for making with blank rectangles: `M-x
  87. clear-rectangle' to blank out existing text, and `C-x r o'
  88. (`open-rectangle') to insert a blank rectangle.  Clearing a rectangle
  89. is equivalent to deleting it and then inserting a blank rectangle of
  90. the same size.
  91.  
  92.    The command `M-x string-rectangle' is similar to `C-x r o', but it
  93. inserts a specified string instead of blanks.  You specify the string
  94. with the minibuffer.  Since the length of the string specifies how many
  95. columns to insert, the width of the region-rectangle does not matter
  96. for this command.  What does matter is the position of the left edge
  97. (which specifies the column position for the insertion in each line)
  98. and the range of lines that the rectangle occupies.  The previous
  99. contents of the text beyond the insertion column are pushed rightward.
  100.  
  101. 
  102. File: emacs,  Node: Registers,  Next: Display,  Prev: Rectangles,  Up: Top
  103.  
  104. Registers
  105. *********
  106.  
  107.    Emacs "registers" are places you can save text or positions for
  108. later use.  Once you save text or a rectangle in a register, you can
  109. copy it into the buffer once or many times; you can move point to a
  110. position saved in a register once or many times.
  111.  
  112.    Each register has a name which is a single character.  A register can
  113. store a piece of text, a rectangle, a position, a window configuration,
  114. or a file name, but only one thing at any given time.  Whatever you
  115. store in a register remains there until you store something else in that
  116. register.  To see what a register R contains, use `M-x view-register'.
  117.  
  118. `M-x view-register RET R'
  119.      Display a description of what register R contains.
  120.  
  121. * Menu:
  122.  
  123. * Position: RegPos.           Saving positions in registers.
  124. * Text: RegText.              Saving text in registers.
  125. * Rectangle: RegRect.         Saving rectangles in registers.
  126. * Configurations: RegConfig.  Saving window configurations in registers.
  127. * Files: RegFiles.            File names in registers.
  128. * Bookmarks::                 Bookmarks are like registers, but persistent.
  129.  
  130. 
  131. File: emacs,  Node: RegPos,  Next: RegText,  Up: Registers
  132.  
  133. Saving Positions in Registers
  134. =============================
  135.  
  136.    Saving a position records a place in a buffer so that you can move
  137. back there later.  Moving to a saved position switches to that buffer
  138. and moves point to that place in it.
  139.  
  140. `C-x r SPC R'
  141.      Save position of point in register R (`point-to-register').
  142.  
  143. `C-x r j R'
  144.      Jump to the position saved in register R (`jump-to-register').
  145.  
  146.    To save the current position of point in a register, choose a name R
  147. and type `C-x r SPC R'.  The register R retains the position thus saved
  148. until you store something else in that register.
  149.  
  150.    The command `C-x r j R' moves point to the position recorded in
  151. register R.  The register is not affected; it continues to record the
  152. same position.  You can jump to the saved position any number of times.
  153.  
  154. 
  155. File: emacs,  Node: RegText,  Next: RegRect,  Prev: RegPos,  Up: Registers
  156.  
  157. Saving Text in Registers
  158. ========================
  159.  
  160.    When you want to insert a copy of the same piece of text several
  161. times, it may be inconvenient to yank it from the kill ring, since each
  162. subsequent kill moves that entry further down the ring.  An alternative
  163. is to store the text in a register and later retrieve it.
  164.  
  165. `C-x r s R'
  166.      Copy region into register R (`copy-to-register').
  167.  
  168. `C-x r i R'
  169.      Insert text from register R (`insert-register').
  170.  
  171.    `C-x r s R' stores a copy of the text of the region into the
  172. register named R.  Given a numeric argument, `C-x r s R' deletes the
  173. text from the buffer as well.
  174.  
  175.    `C-x r i R' inserts in the buffer the text from register R.
  176. Normally it leaves point before the text and places the mark after, but
  177. with a numeric argument (`C-u') it puts point after the text and the
  178. mark before.
  179.  
  180. 
  181. File: emacs,  Node: RegRect,  Next: RegConfig,  Prev: RegText,  Up: Registers
  182.  
  183. Saving Rectangles in Registers
  184. ==============================
  185.  
  186.    A register can contain a rectangle instead of linear text.  The
  187. rectangle is represented as a list of strings.  *Note Rectangles::, for
  188. basic information on how to specify a rectangle in the buffer.
  189.  
  190. `C-x r r R'
  191.      Copy the region-rectangle into register R
  192.      (`copy-rectangle-to-register').  With numeric argument, delete it
  193.      as well.
  194.  
  195. `C-x r i R'
  196.      Insert the rectangle stored in register R (if it contains a
  197.      rectangle) (`insert-register').
  198.  
  199.    The `C-x r i R' command inserts a text string if the register
  200. contains one, and inserts a rectangle if the register contains one.
  201.  
  202.    See also the command `sort-columns', which you can think of as
  203. sorting a rectangle.  *Note Sorting::.
  204.  
  205. 
  206. File: emacs,  Node: RegConfig,  Next: RegFiles,  Prev: RegRect,  Up: Registers
  207.  
  208. Saving Window Configurations in Registers
  209. =========================================
  210.  
  211.    You can save the window configuration of the selected frame in a
  212. register, or even the configuration of all windows in all frames, and
  213. restore the configuration later.
  214.  
  215. `C-x r w R'
  216.      Save the state of the selected frame's windows in register R
  217.      (`window-configuration-to-register').
  218.  
  219. `C-x r f R'
  220.      Save the state of all frames, including all their windows, in
  221.      register R (`frame-configuration-to-register').
  222.  
  223.    Use `C-x r j R' to restore a window or frame configuration.  This is
  224. the same command used to restore a cursor position.  When you restore a
  225. frame configuration, any existing frames not included in the
  226. configuration become invisible.  If you wish to delete these frames
  227. instead, use `C-u C-x r j R'.
  228.  
  229. 
  230. File: emacs,  Node: RegFiles,  Next: Bookmarks,  Prev: RegConfig,  Up: Registers
  231.  
  232. Keeping File Names in Registers
  233. ===============================
  234.  
  235.    If you visit certain file names frequently, you can visit them more
  236. conveniently if you put their names in registers.  Here's the Lisp code
  237. used to put a file name in a register:
  238.  
  239.      (set-register ?R '(file . NAME))
  240.  
  241. For example,
  242.  
  243.      (set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog"))
  244.  
  245. puts the file name shown in register `z'.
  246.  
  247.    To visit the file whose name is in register R, type `C-x r j R'.
  248. (This is the same command used to jump to a position or restore a frame
  249. configuration.)
  250.  
  251. 
  252. File: emacs,  Node: Bookmarks,  Prev: RegFiles,  Up: Registers
  253.  
  254. Bookmarks
  255. =========
  256.  
  257.    "Bookmarks" are somewhat like registers in that they record
  258. positions you can jump to.  Unlike registers, they have long names, and
  259. they persist automatically from one Emacs session to the next.  The
  260. prototypical use of bookmarks is to record "where you were reading" in
  261. various files.
  262.  
  263. `C-x r m RET'
  264.      Set the bookmark for the visited file, at point.
  265.  
  266. `C-x r m BOOKMARK RET'
  267.      Set the bookmark named BOOKMARK at point (`bookmark-set').
  268.  
  269. `C-x r b BOOKMARK RET'
  270.      Jump to the bookmark named BOOKMARK (`bookmark-jump').
  271.  
  272. `C-x r l'
  273.      List all bookmarks (`list-bookmarks').
  274.  
  275. `M-x bookmark-save'
  276.      Save all the current bookmark values in the default bookmark file.
  277.  
  278.    The prototypical use for bookmarks is to record one current position
  279. in each of several files.  So the command `C-x r m', which sets a
  280. bookmark, uses the visited file name as the default for the bookmark
  281. name.  If you name each bookmark after the file it points to, then you
  282. can conveniently revisit any of those files with `C-x r b', and move to
  283. the position of the bookmark at the same time.
  284.  
  285.    To display a list of all your bookmarks in a separate buffer, type
  286. `C-x r l' (`list-bookmarks').  If you switch to that buffer, you can
  287. use it to edit your bookmark definitions or annotate the bookmarks.
  288. Type `C-h m' in that buffer for more information about its special
  289. editing commands.
  290.  
  291.    When you kill Emacs, Emacs offers to save your bookmark values in
  292. your default bookmark file, `~/.emacs.bmk', if you have changed any
  293. bookmark values.  You can also save the bookmarks at any time with the
  294. `M-x bookmark-save' command.  The bookmark commands load your default
  295. bookmark file automatically.  This saving and loading is how bookmarks
  296. persist from one Emacs session to the next.
  297.  
  298.    If you set the variable `bookmark-save-flag' to 1, then each command
  299. that sets a bookmark will also save your bookmarks; this way, you don't
  300. lose any bookmark values even if Emacs crashes.  (The value, if a
  301. number, says how many bookmark modifications should go by between
  302. saving.)
  303.  
  304.    Bookmark position values are saved with surrounding context, so that
  305. `bookmark-jump' can find the proper position even if the file is
  306. modified slightly.  The variable `bookmark-search-size' says how many
  307. characters of context to record, on each side of the bookmark's
  308. position.
  309.  
  310.    Here are some additional commands for working with bookmarks:
  311.  
  312. `M-x bookmark-load RET FILENAME RET'
  313.      Load a file named FILENAME that contains a list of bookmark
  314.      values.  You can use this command, as well as `bookmark-write', to
  315.      work with other files of bookmark values in addition to your
  316.      default bookmark file.
  317.  
  318. `M-x bookmark-write RET FILENAME RET'
  319.      Save all the current bookmark values in the file FILENAME.
  320.  
  321. `M-x bookmark-delete RET BOOKMARK RET'
  322.      Delete the bookmark named BOOKMARK.
  323.  
  324. `M-x bookmark-insert-location RET BOOKMARK RET'
  325.      Insert in the buffer the name of the file that bookmark BOOKMARK
  326.      points to.
  327.  
  328. `M-x bookmark-insert RET BOOKMARK RET'
  329.      Insert in the buffer the *contents* of the file that bookmark
  330.      BOOKMARK points to.
  331.  
  332. 
  333. File: emacs,  Node: Display,  Next: Search,  Prev: Registers,  Up: Top
  334.  
  335. Controlling the Display
  336. ***********************
  337.  
  338.    Since only part of a large buffer fits in the window, Emacs tries to
  339. show the part that is likely to be interesting.  The display control
  340. commands allow you to specify which part of the text you want to see.
  341.  
  342. `C-l'
  343.      Clear screen and redisplay, scrolling the selected window to center
  344.      point vertically within it (`recenter').
  345.  
  346. `C-v'
  347.      Scroll forward (a windowful or a specified number of lines)
  348.      (`scroll-up').
  349.  
  350. `NEXT'
  351.      Likewise, scroll forward.
  352.  
  353. `M-v'
  354.      Scroll backward (`scroll-down').
  355.  
  356. `PRIOR'
  357.      Likewise, scroll backward.
  358.  
  359. `ARG C-l'
  360.      Scroll so point is on screen line ARG (`recenter').
  361.  
  362. `C-x <'
  363.      Scroll text in current window to the left (`scroll-left').
  364.  
  365. `C-x >'
  366.      Scroll to the right (`scroll-right').
  367.  
  368. `C-x $'
  369.      Make deeply indented lines invisible (`set-selective-display').
  370.  
  371.    The names of all scroll commands are based on the direction that the
  372. text moves in the window.  Thus, the command to scrolling forward is
  373. called `scroll-up', since the text moves up.
  374.  
  375. * Menu:
  376.  
  377. * Scrolling::               Moving text up and down in a window.
  378. * Horizontal Scrolling::   Moving text left and right in a window.
  379. * Selective Display::      Hiding lines with lots of indentation.
  380. * European Display::       Displaying (and entering) European characters.
  381. * Follow Mode::            Follow mode lets two windows scroll as one.
  382. * Optional Mode Line::     Optional mode line display features.
  383. * Display Vars::           Information on variables for customizing display.
  384.  
  385. 
  386. File: emacs,  Node: Scrolling,  Next: Horizontal Scrolling,  Up: Display
  387.  
  388. Scrolling
  389. =========
  390.  
  391.    If a buffer contains text that is too large to fit entirely within a
  392. window that is displaying the buffer, Emacs shows a contiguous portion
  393. of the text.  The portion shown always contains point.
  394.  
  395.    "Scrolling" means moving text up or down in the window so that
  396. different parts of the text are visible.  Scrolling forward means that
  397. text moves up, and new text appears at the bottom.  Scrolling backward
  398. moves text down and new text appears at the top.
  399.  
  400.    Scrolling happens automatically if you move point past the bottom or
  401. top of the window.  You can also explicitly request scrolling with the
  402. commands in this section.
  403.  
  404. `C-l'
  405.      Clear screen and redisplay, scrolling the selected window to center
  406.      point vertically within it (`recenter').
  407.  
  408. `C-v'
  409.      Scroll forward (a windowful or a specified number of lines)
  410.      (`scroll-up').
  411.  
  412. `NEXT'
  413.      Likewise, scroll forward.
  414.  
  415. `M-v'
  416.      Scroll backward (`scroll-down').
  417.  
  418. `PRIOR'
  419.      Likewise, scroll backward.
  420.  
  421. `ARG C-l'
  422.      Scroll so point is on line ARG (`recenter').
  423.  
  424. `C-M-l'
  425.      Scroll heuristically to bring useful information onto the screen
  426.      (`reposition-window').
  427.  
  428.    The most basic scrolling command is `C-l' (`recenter') with no
  429. argument.  It clears the entire screen and redisplays all windows.  In
  430. addition, it scrolls the selected window so that point is halfway down
  431. from the top of the window.
  432.  
  433.    The scrolling commands `C-v' and `M-v' let you move all the text in
  434. the window up or down a few lines.  `C-v' (`scroll-up') with an
  435. argument shows you that many more lines at the bottom of the window,
  436. moving the text and point up together as `C-l' might.  `C-v' with a
  437. negative argument shows you more lines at the top of the window.  `M-v'
  438. (`scroll-down') is like `C-v', but moves in the opposite direction.
  439. The function keys NEXT and PRIOR are equivalent to `C-v' and `M-v'.
  440.  
  441.    To read the buffer a windowful at a time, use `C-v' with no argument.
  442. It takes the last two lines at the bottom of the window and puts them at
  443. the top, followed by nearly a whole windowful of lines not previously
  444. visible.  If point was in the text scrolled off the top, it moves to the
  445. new top of the window.  `M-v' with no argument moves backward with
  446. overlap similarly.  The number of lines of overlap across a `C-v' or
  447. `M-v' is controlled by the variable `next-screen-context-lines'; by
  448. default, it is two.
  449.  
  450.    Another way to do scrolling is with `C-l' with a numeric argument.
  451. `C-l' does not clear the screen when given an argument; it only scrolls
  452. the selected window.  With a positive argument N, it repositions text
  453. to put point N lines down from the top.  An argument of zero puts point
  454. on the very top line.  Point does not move with respect to the text;
  455. rather, the text and point move rigidly on the screen.  `C-l' with a
  456. negative argument puts point that many lines from the bottom of the
  457. window.  For example, `C-u - 1 C-l' puts point on the bottom line, and
  458. `C-u - 5 C-l' puts it five lines from the bottom.  Just `C-u' as
  459. argument, as in `C-u C-l', scrolls point to the center of the screen.
  460.  
  461.    The `C-M-l' command (`reposition-window') scrolls the current window
  462. heuristically in a way designed to get useful information onto the
  463. screen.  For example, in a Lisp file, this command tries to get the
  464. entire current defun onto the screen if possible.
  465.  
  466.    Scrolling happens automatically if point has moved out of the visible
  467. portion of the text when it is time to display.  Usually the scrolling
  468. is done so as to put point vertically centered within the window.
  469. However, if the variable `scroll-step' has a nonzero value, an attempt
  470. is made to scroll the buffer by that many lines; if that is enough to
  471. bring point back into visibility, that is what is done.
  472.  
  473. 
  474. File: emacs,  Node: Horizontal Scrolling,  Next: Selective Display,  Prev: Scrolling,  Up: Display
  475.  
  476. Horizontal Scrolling
  477. ====================
  478.  
  479. `C-x <'
  480.      Scroll text in current window to the left (`scroll-left').
  481.  
  482. `C-x >'
  483.      Scroll to the right (`scroll-right').
  484.  
  485.    The text in a window can also be scrolled horizontally.  This means
  486. that each line of text is shifted sideways in the window, and one or
  487. more characters at the beginning of each line are not displayed at all.
  488. When a window has been scrolled horizontally in this way, text lines
  489. are truncated rather than continued (*note Continuation Lines::.), with
  490. a `$' appearing in the first column when there is text truncated to the
  491. left, and in the last column when there is text truncated to the right.
  492.  
  493.    The command `C-x <' (`scroll-left') scrolls the selected window to
  494. the left by N columns with argument N.  This moves part of the
  495. beginning of each line off the left edge of the window.  With no
  496. argument, it scrolls by almost the full width of the window (two
  497. columns less, to be precise).
  498.  
  499.    `C-x >' (`scroll-right') scrolls similarly to the right.  The window
  500. cannot be scrolled any farther to the right once it is displayed
  501. normally (with each line starting at the window's left margin);
  502. attempting to do so has no effect.  This means that you don't have to
  503. calculate the argument precisely for `C-x >'; any sufficiently large
  504. argument will restore normally display.
  505.  
  506. 
  507. File: emacs,  Node: Selective Display,  Next: European Display,  Prev: Horizontal Scrolling,  Up: Display
  508.  
  509. Selective Display
  510. =================
  511.  
  512.    Emacs has the ability to hide lines indented more than a certain
  513. number of columns (you specify how many columns).  You can use this to
  514. get an overview of a part of a program.
  515.  
  516.    To hide lines, type `C-x $' (`set-selective-display') with a numeric
  517. argument N.  Then lines with at least N columns of indentation
  518. disappear from the screen.  The only indication of their presence is
  519. that three dots (`...') appear at the end of each visible line that is
  520. followed by one or more hidden ones.
  521.  
  522.    The commands `C-n' and `C-p' move across the hidden lines as if they
  523. were not there.
  524.  
  525.    The hidden lines are still present in the buffer, and most editing
  526. commands see them as usual, so you may find point in the middle of the
  527. hidden text.  When this happens, the cursor appears at the end of the
  528. previous line, after the three dots.  If point is at the end of the
  529. visible line, before the newline that ends it, the cursor appears before
  530. the three dots.
  531.  
  532.    To make all lines visible again, type `C-x $' with no argument.
  533.  
  534.    If you set the variable `selective-display-ellipses' to `nil', the
  535. three dots do not appear at the end of a line that precedes hidden
  536. lines.  Then there is no visible indication of the hidden lines.  This
  537. variable becomes local automatically when set.
  538.  
  539. 
  540. File: emacs,  Node: European Display,  Next: Follow Mode,  Prev: Selective Display,  Up: Display
  541.  
  542. European Character Set Display
  543. ==============================
  544.  
  545.    Some European languages use accented letters and other special
  546. symbols.  The ISO 8859 Latin-1 character set defines character codes for
  547. many European languages in the range 160 to 255.
  548.  
  549.    Emacs can display those characters according to Latin-1, provided the
  550. terminal or font in use supports them.  The `M-x
  551. standard-display-european' command toggles European character display
  552. mode.  With a numeric argument, `M-x standard-display-european' enables
  553. European character display if and only if the argument is positive.
  554. Load the library `iso-syntax' to specify the correct syntactic
  555. properties and case conversion table for the Latin-1 character set.
  556.  
  557.    If your terminal does not support display of the Latin-1 character
  558. set, Emacs can display these characters as ASCII sequences which at
  559. least give you a clear idea of what the characters are.  To do this,
  560. load the library `iso-ascii'.
  561.  
  562.    Some operating systems let you specify the language you are using by
  563. setting a locale.  Emacs handles one common special case of this: if
  564. your locale name for character types contains the string `8859-1' or
  565. `88591', Emacs automatically enables European character display mode
  566. and its syntax.
  567.  
  568.    There are three different ways you can enter Latin-1 characters:
  569.  
  570.    * If your keyboard can generate character codes 128 and up,
  571.      representing ISO Latin-1 characters, execute the following
  572.      expression to enable Emacs to understand them:
  573.  
  574.           (set-input-mode (car (current-input-mode))
  575.                           (nth 1 (current-input-mode))
  576.                           0)
  577.  
  578.    * You can load the library `iso-transl' to turn the key `C-x 8' into
  579.      a "compose character" prefix for entry of the extra ISO Latin-1
  580.      printing characters.  `C-x 8' is good for insertion (in the
  581.      minibuffer as well as other buffers), for searching, and in any
  582.      other context where a key sequence is allowed.  The ALT modifier
  583.      key, if you have one, serves the same purpose as `C-x 8'; use ALT
  584.      together with an accent character to modify the following letter.
  585.  
  586.    * You can use ISO Accents mode.  This minor mode is convenient if you
  587.      enter non-ASCII ISO Latin-1 characters often.  When this minor
  588.      mode is enabled, the characters ``', `'', `"', `^', `/' and `~'
  589.      modify the following letter by adding the corresponding
  590.      diacritical mark to it, if possible.  To enable or disable ISO
  591.      Accents mode, use the command `M-x iso-accents-mode'.  This
  592.      command affects only the current buffer.
  593.  
  594.      To enter one of those six special characters while in ISO Accents
  595.      mode, type the character, followed by a space.  Some of those
  596.      characters have a corresponding "dead key" accent character in the
  597.      ISO Latin-1 character set; to enter that character, type the
  598.      corresponding ASCII character twice.  For example, `''' enters the
  599.      Latin-1 character acute-accent (character code 0264).
  600.  
  601.      ISO Accents mode input is available whenever a key sequence is
  602.      expected: for ordinary insertion, for searching, for the
  603.      minibuffer, and for certain command arguments.
  604.  
  605.      In addition to the accented letters, you can use these special
  606.      sequences in ISO Accents mode to enter certain other ISO Latin-1
  607.      characters:
  608.  
  609.     `/A'
  610.           `A' with ring.
  611.  
  612.     `~C'
  613.           `C' with cedilla.
  614.  
  615.     `~D'
  616.           `D' with stroke.
  617.  
  618.     `/E'
  619.           `AE' ligature.
  620.  
  621.     `/a'
  622.           `a' with ring.
  623.  
  624.     `~c'
  625.           `c' with cedilla.
  626.  
  627.     `~d'
  628.           `d' with stroke.
  629.  
  630.     `/e'
  631.           `ae' ligature.
  632.  
  633.     `"s'
  634.           German sharp `s'.
  635.  
  636.     `~<'
  637.           Left guillemot.
  638.  
  639.     `~>'
  640.           Right guillemot.
  641.  
  642.     `~!'
  643.           Inverted exclamation mark.
  644.  
  645.     `~?'
  646.           Inverted question mark.
  647.  
  648. 
  649. File: emacs,  Node: Follow Mode,  Next: Optional Mode Line,  Prev: European Display,  Up: Display
  650.  
  651. Follow Mode
  652. ===========
  653.  
  654.    "Follow mode" is a minor mode which makes two windows showing the
  655. same buffer scroll as one tall "virtual window."  To use Follow mode,
  656. go to a frame with just one window, split it into two side-by-side
  657. windows using `C-x 3', and then type `M-x follow-mode'.  From then on,
  658. you can edit the buffer in either of the two windows, or scroll either
  659. one; the other window follows it.
  660.  
  661.    To turn off Follow mode, type `M-x follow-mode' a second time.
  662.  
  663. 
  664. File: emacs,  Node: Optional Mode Line,  Next: Display Vars,  Prev: Follow Mode,  Up: Display
  665.  
  666. Optional Mode Line Features
  667. ===========================
  668.  
  669.    The current line number of point appears in the mode line when Line
  670. Number mode is enabled.  Use the command `M-x line-number-mode' to turn
  671. this mode on and off; normally it is on.  The line number appears
  672. before the buffer percentage POS, with the letter `L' to indicate what
  673. it is.  *Note Minor Modes::, for more information about minor modes and
  674. about how to use this command.
  675.  
  676.    If the buffer is very large (larger than the value of
  677. `line-number-display-limit'), then the line number doesn't appear.
  678. Emacs doesn't compute the line number when the buffer is large, because
  679. that would be too slow.  If you have narrowed the buffer (*note
  680. Narrowing::.), the displayed line number is relative to the accessible
  681. portion of the buffer.
  682.  
  683.    You can also display the current column number by turning on Column
  684. Number mode.  It displays the current column number preceded by the
  685. letter `C'.  Type `M-x column-number-mode' to toggle this mode.
  686.  
  687.    Emacs can optionally display the time and system load in all mode
  688. lines.  To enable this feature, type `M-x display-time'.  The
  689. information added to the mode line usually appears after the buffer
  690. name, before the mode names and their parentheses.  It looks like this:
  691.  
  692.      HH:MMpm L.LL
  693.  
  694. Here HH and MM are the hour and minute, followed always by `am' or
  695. `pm'.  L.LL is the average number of running processes in the whole
  696. system recently.  (Some fields may be missing if your operating system
  697. cannot support them.)
  698.  
  699.    The word `Mail' appears after the load level if there is mail for
  700. you that you have not read yet.
  701.  
  702. 
  703. File: emacs,  Node: Display Vars,  Prev: Optional Mode Line,  Up: Display
  704.  
  705. Variables Controlling Display
  706. =============================
  707.  
  708.    This section contains information for customization only.  Beginning
  709. users should skip it.
  710.  
  711.    The variable `mode-line-inverse-video' controls whether the mode
  712. line is displayed in inverse video (assuming the terminal supports it);
  713. `nil' means don't do so.  *Note Mode Line::.  If you specify the
  714. foreground color for the `modeline' face, and `mode-line-inverse-video'
  715. is non-`nil', then the default background color for that face is the
  716. usual foreground color.  *Note Faces::.
  717.  
  718.    If the variable `inverse-video' is non-`nil', Emacs attempts to
  719. invert all the lines of the display from what they normally are.
  720.  
  721.    If the variable `visible-bell' is non-`nil', Emacs attempts to make
  722. the whole screen blink when it would normally make an audible bell
  723. sound.  This variable has no effect if your terminal does not have a way
  724. to make the screen blink.
  725.  
  726.    When you reenter Emacs after suspending, Emacs normally clears the
  727. screen and redraws the entire display.  On some terminals with more than
  728. one page of memory, it is possible to arrange the termcap entry so that
  729. the `ti' and `te' strings (output to the terminal when Emacs is entered
  730. and exited, respectively) switch between pages of memory so as to use
  731. one page for Emacs and another page for other output.  Then you might
  732. want to set the variable `no-redraw-on-reenter' non-`nil'; this tells
  733. Emacs to assume, when resumed, that the screen page it is using still
  734. contains what Emacs last wrote there.
  735.  
  736.    The variable `echo-keystrokes' controls the echoing of
  737. multi-character keys; its value is the number of seconds of pause
  738. required to cause echoing to start, or zero meaning don't echo at all.
  739. *Note Echo Area::.
  740.  
  741.    If the variable `ctl-arrow' is `nil', control characters in the
  742. buffer are displayed with octal escape sequences, all except newline
  743. and tab.  Altering the value of `ctl-arrow' makes it local to the
  744. current buffer; until that time, the default value is in effect.  The
  745. default is initially `t'.  *Note Display Tables: (elisp)Display Tables.
  746.  
  747.    Normally, a tab character in the buffer is displayed as whitespace
  748. which extends to the next display tab stop position, and display tab
  749. stops come at intervals equal to eight spaces.  The number of spaces
  750. per tab is controlled by the variable `tab-width', which is made local
  751. by changing it, just like `ctl-arrow'.  Note that how the tab character
  752. in the buffer is displayed has nothing to do with the definition of TAB
  753. as a command.  The variable `tab-width' must have an integer value
  754. between 1 and 1000, inclusive.
  755.  
  756.    If the variable `truncate-lines' is non-`nil', then each line of
  757. text gets just one screen line for display; if the text line is too
  758. long, display shows only the part that fits.  If `truncate-lines' is
  759. `nil', then long text lines display as more than one screen line,
  760. enough to show the whole text of the line.  *Note Continuation Lines::.
  761. Altering the value of `truncate-lines' makes it local to the current
  762. buffer; until that time, the default value is in effect.  The default
  763. is initially `nil'.
  764.  
  765.    If the variable `truncate-partial-width-windows' is non-`nil', it
  766. forces truncation rather than continuation in any window less than the
  767. full width of the screen or frame, regardless of the value of
  768. `truncate-lines'.  For information about side-by-side windows, see
  769. *Note Split Window::.  See also *Note Display: (elisp)Display.
  770.  
  771.    The variable `baud-rate' holds the the output speed of the terminal,
  772. as far as Emacs knows.  Setting this variable does not change the speed
  773. of actual data transmission, but the value is used for calculations
  774. such as padding.  It also affects decisions about whether to scroll
  775. part of the screen or redraw it instead--even when using a window
  776. system.  (We designed it this way, despite the fact that a window
  777. system has no true "output speed", to give you a way to tune these
  778. decisions.)
  779.  
  780. 
  781. File: emacs,  Node: Search,  Next: Fixit,  Prev: Display,  Up: Top
  782.  
  783. Searching and Replacement
  784. *************************
  785.  
  786.    Like other editors, Emacs has commands for searching for occurrences
  787. of a string.  The principal search command is unusual in that it is
  788. "incremental"; it begins to search before you have finished typing the
  789. search string.  There are also nonincremental search commands more like
  790. those of other editors.
  791.  
  792.    Besides the usual `replace-string' command that finds all
  793. occurrences of one string and replaces them with another, Emacs has a
  794. fancy replacement command called `query-replace' which asks
  795. interactively which occurrences to replace.
  796.  
  797. * Menu:
  798.  
  799. * Incremental Search::       Search happens as you type the string.
  800. * Nonincremental Search::  Specify entire string and then search.
  801. * Word Search::           Search for sequence of words.
  802. * Regexp Search::       Search for match for a regexp.
  803. * Regexps::           Syntax of regular expressions.
  804. * Search Case::           To ignore case while searching, or not.
  805. * Replace::           Search, and replace some or all matches.
  806. * Other Repeating Search:: Operating on all matches for some regexp.
  807.  
  808. 
  809. File: emacs,  Node: Incremental Search,  Next: Nonincremental Search,  Prev: Search,  Up: Search
  810.  
  811. Incremental Search
  812. ==================
  813.  
  814.    An incremental search begins searching as soon as you type the first
  815. character of the search string.  As you type in the search string, Emacs
  816. shows you where the string (as you have typed it so far) would be
  817. found.  When you have typed enough characters to identify the place you
  818. want, you can stop.  Depending on what you plan to do next, you may or
  819. may not need to terminate the search explicitly with RET.
  820.  
  821. `C-s'
  822.      Incremental search forward (`isearch-forward').
  823.  
  824. `C-r'
  825.      Incremental search backward (`isearch-backward').
  826.  
  827.    `C-s' starts an incremental search.  `C-s' reads characters from the
  828. keyboard and positions the cursor at the first occurrence of the
  829. characters that you have typed.  If you type `C-s' and then `F', the
  830. cursor moves right after the first `F'.  Type an `O', and see the
  831. cursor move to after the first `FO'.  After another `O', the cursor is
  832. after the first `FOO' after the place where you started the search.
  833. Meanwhile, the search string `FOO' has been echoed in the echo area.
  834.  
  835.    If you make a mistake in typing the search string, you can cancel
  836. characters with DEL.  Each DEL cancels the last character of search
  837. string.  This does not happen until Emacs is ready to read another
  838. input character; first it must either find, or fail to find, the
  839. character you want to erase.  If you do not want to wait for this to
  840. happen, use `C-g' as described below.
  841.  
  842.    When you are satisfied with the place you have reached, you can type
  843. RET, which stops searching, leaving the cursor where the search brought
  844. it.  Also, any command not specially meaningful in searches stops the
  845. searching and is then executed.  Thus, typing `C-a' would exit the
  846. search and then move to the beginning of the line.  RET is necessary
  847. only if the next command you want to type is a printing character, DEL,
  848. RET, or another control character that is special within searches
  849. (`C-q', `C-w', `C-r', `C-s', `C-y', `M-y', `M-r', or `M-s').
  850.  
  851.    Sometimes you search for `FOO' and find it, but not the one you
  852. expected to find.  There was a second `FOO' that you forgot about,
  853. before the one you were looking for.  In this event, type another `C-s'
  854. to move to the next occurrence of the search string.  This can be done
  855. any number of times.  If you overshoot, you can cancel some `C-s'
  856. characters with DEL.
  857.  
  858.    After you exit a search, you can search for the same string again by
  859. typing just `C-s C-s': the first `C-s' is the key that invokes
  860. incremental search, and the second `C-s' means "search again".
  861.  
  862.    To reuse earlier search strings, use the "search ring".  The
  863. commands `M-p' and `M-n' move through the ring to pick a search string
  864. to reuse.  These commands leave the selected search ring element in the
  865. minibuffer, where you can edit it.  Type `C-s' or `C-r' to terminate
  866. editing the string and search for it.
  867.  
  868.    If your string is not found at all, the echo area says `Failing
  869. I-Search'.  The cursor is after the place where Emacs found as much of
  870. your string as it could.  Thus, if you search for `FOOT', and there is
  871. no `FOOT', you might see the cursor after the `FOO' in `FOOL'.  At this
  872. point there are several things you can do.  If your string was
  873. mistyped, you can rub some of it out and correct it.  If you like the
  874. place you have found, you can type RET or some other Emacs command to
  875. "accept what the search offered".  Or you can type `C-g', which removes
  876. from the search string the characters that could not be found (the `T'
  877. in `FOOT'), leaving those that were found (the `FOO' in `FOOT').  A
  878. second `C-g' at that point cancels the search entirely, returning point
  879. to where it was when the search started.
  880.  
  881.    An upper-case letter in the search string makes the search
  882. case-sensitive.  If you delete the upper-case character from the search
  883. string, it ceases to have this effect.  *Note Search Case::.
  884.  
  885.    If a search is failing and you ask to repeat it by typing another
  886. `C-s', it starts again from the beginning of the buffer.  Repeating a
  887. failing reverse search with `C-r' starts again from the end.  This is
  888. called "wrapping around".  `Wrapped' appears in the search prompt once
  889. this has happened.  If you keep on going past the original starting
  890. point of the search, it changes to `Overwrapped', which means that you
  891. are revisiting matches that you have already seen.
  892.  
  893.    The `C-g' "quit" character does special things during searches; just
  894. what it does depends on the status of the search.  If the search has
  895. found what you specified and is waiting for input, `C-g' cancels the
  896. entire search.  The cursor moves back to where you started the search.
  897. If `C-g' is typed when there are characters in the search string that
  898. have not been found--because Emacs is still searching for them, or
  899. because it has failed to find them--then the search string characters
  900. which have not been found are discarded from the search string.  With
  901. them gone, the search is now successful and waiting for more input, so
  902. a second `C-g' will cancel the entire search.
  903.  
  904.    To search for a newline, type LFD (also known as `C-j').  To search
  905. for another control character such as control-S or carriage return, you
  906. must quote it by typing `C-q' first.  This function of `C-q' is
  907. analogous to its meaning as an Emacs command: it causes the following
  908. character to be treated the way a graphic character would normally be
  909. treated in the same context.  You can also specify a character by its
  910. octal code: enter `C-q' followed by three octal digits.
  911.  
  912.    You can change to searching backwards with `C-r'.  If a search fails
  913. because the place you started was too late in the file, you should do
  914. this.  Repeated `C-r' keeps looking for more occurrences backwards.  A
  915. `C-s' starts going forwards again.  `C-r' in a search can be canceled
  916. with DEL.
  917.  
  918.    If you know initially that you want to search backwards, you can use
  919. `C-r' instead of `C-s' to start the search, because `C-r' as a key runs
  920. a command (`isearch-backward') to search backward.
  921.  
  922.    The characters `C-y' and `C-w' can be used in incremental search to
  923. grab text from the buffer into the search string.  This makes it
  924. convenient to search for another occurrence of text at point.  `C-w'
  925. copies the word after point as part of the search string, advancing
  926. point over that word.  Another `C-s' to repeat the search will then
  927. search for a string including that word.  `C-y' is similar to `C-w' but
  928. copies all the rest of the current line into the search string.  Both
  929. `C-y' and `C-w' convert the text they copy to lower case if the search
  930. is current not case-sensitive; this is so the search remains
  931. case-insensitive.
  932.  
  933.    The character `M-y' copies text from the kill ring into the search
  934. string.  It uses the same text that `C-y' as a command would yank.
  935. *Note Yanking::.
  936.  
  937.    When you exit the incremental search, it sets the mark to where point
  938. *was*, before the search.  That is convenient for moving back there.
  939. In Transient Mark mode, incremental search sets the mark without
  940. activating it, and does so only if the mark is not already active.
  941.  
  942.    To customize the special characters that incremental search
  943. understands, alter their bindings in the keymap `isearch-mode-map'.
  944. For a list of bindings, look at the documentation of `isearch-mode' with
  945. `C-h f isearch-mode RET'.
  946.  
  947. Slow Terminal Incremental Search
  948. --------------------------------
  949.  
  950.    Incremental search on a slow terminal uses a modified style of
  951. display that is designed to take less time.  Instead of redisplaying
  952. the buffer at each place the search gets to, it creates a new
  953. single-line window and uses that to display the line that the search
  954. has found.  The single-line window comes into play as soon as point
  955. gets outside of the text that is already on the screen.
  956.  
  957.    When you terminate the search, the single-line window is removed.
  958. Then Emacs redisplays the window in which the search was done, to show
  959. its new position of point.
  960.  
  961.    The slow terminal style of display is used when the terminal baud
  962. rate is less than or equal to the value of the variable
  963. `search-slow-speed', initially 1200.
  964.  
  965.    The number of lines to use in slow terminal search display is
  966. controlled by the variable `search-slow-window-lines'.  1 is its normal
  967. value.
  968.  
  969. 
  970. File: emacs,  Node: Nonincremental Search,  Next: Word Search,  Prev: Incremental Search,  Up: Search
  971.  
  972. Nonincremental Search
  973. =====================
  974.  
  975.    Emacs also has conventional nonincremental search commands, which
  976. require you to type the entire search string before searching begins.
  977.  
  978. `C-s RET STRING RET'
  979.      Search for STRING.
  980.  
  981. `C-r RET STRING RET'
  982.      Search backward for STRING.
  983.  
  984.    To do a nonincremental search, first type `C-s RET'.  This enters
  985. the minibuffer to read the search string; terminate the string with
  986. RET, and then the search takes place.  If the string is not found, the
  987. search command gets an error.
  988.  
  989.    The way `C-s RET' works is that the `C-s' invokes incremental
  990. search, which is specially programmed to invoke nonincremental search
  991. if the argument you give it is empty.  (Such an empty argument would
  992. otherwise be useless.)  `C-r RET' also works this way.
  993.  
  994.    However, nonincremental searches performed using `C-s RET' do not
  995. call `search-forward' right away.  The first thing done is to see if
  996. the next character is `C-w', which requests a word search.  *Note Word
  997. Search::.
  998.  
  999.    Forward and backward nonincremental searches are implemented by the
  1000. commands `search-forward' and `search-backward'.  These commands may be
  1001. bound to keys in the usual manner.  The feature that you can get to
  1002. them via the incremental search commands exists for historical reasons,
  1003. and to avoid the need to find suitable key sequences for them.
  1004.  
  1005. 
  1006. File: emacs,  Node: Word Search,  Next: Regexp Search,  Prev: Nonincremental Search,  Up: Search
  1007.  
  1008. Word Search
  1009. ===========
  1010.  
  1011.    Word search searches for a sequence of words without regard to how
  1012. the words are separated.  More precisely, you type a string of many
  1013. words, using single spaces to separate them, and the string can be
  1014. found even if there are multiple spaces, newlines or other punctuation
  1015. between the words.
  1016.  
  1017.    Word search is useful for editing a printed document made with a text
  1018. formatter.  If you edit while looking at the printed, formatted version,
  1019. you can't tell where the line breaks are in the source file.  With word
  1020. search, you can search without having to know them.
  1021.  
  1022. `C-s RET C-w WORDS RET'
  1023.      Search for WORDS, ignoring details of punctuation.
  1024.  
  1025. `C-r RET C-w WORDS RET'
  1026.      Search backward for WORDS, ignoring details of punctuation.
  1027.  
  1028.    Word search is a special case of nonincremental search and is invoked
  1029. with `C-s RET C-w'.  This is followed by the search string, which must
  1030. always be terminated with RET.  Being nonincremental, this search does
  1031. not start until the argument is terminated.  It works by constructing a
  1032. regular expression and searching for that; see *Note Regexp Search::.
  1033.  
  1034.    Use `C-r RET C-w' to do backward word search.
  1035.  
  1036.    Forward and backward word searches are implemented by the commands
  1037. `word-search-forward' and `word-search-backward'.  These commands may
  1038. be bound to keys in the usual manner.  The feature that you can get to
  1039. them via the incremental search commands exists for historical reasons,
  1040. and to avoid the need to find suitable key sequences for them.
  1041.  
  1042. 
  1043. File: emacs,  Node: Regexp Search,  Next: Regexps,  Prev: Word Search,  Up: Search
  1044.  
  1045. Regular Expression Search
  1046. =========================
  1047.  
  1048.    A "regular expression" ("regexp", for short) is a pattern that
  1049. denotes a class of alternative strings to match, possibly infinitely
  1050. many.  In GNU Emacs, you can search for the next match for a regexp
  1051. either incrementally or not.
  1052.  
  1053.    Incremental search for a regexp is done by typing `C-M-s'
  1054. (`isearch-forward-regexp').  This command reads a search string
  1055. incrementally just like `C-s', but it treats the search string as a
  1056. regexp rather than looking for an exact match against the text in the
  1057. buffer.  Each time you add text to the search string, you make the
  1058. regexp longer, and the new regexp is searched for.  To search backward
  1059. in the buffer, use `C-M-r' (`isearch-backward-regexp').
  1060.  
  1061.    All of the control characters that do special things within an
  1062. ordinary incremental search have the same function in incremental regexp
  1063. search.  Typing `C-s' or `C-r' immediately after starting the search
  1064. retrieves the last incremental search regexp used; that is to say,
  1065. incremental regexp and non-regexp searches have independent defaults.
  1066. They also have separate search rings that you can access with `M-p' and
  1067. `M-n'.
  1068.  
  1069.    If you type SPC in incremental regexp search, it matches any
  1070. sequence of whitespace characters, including newlines.  If you want to
  1071. match just a space, type `C-q SPC'.
  1072.  
  1073.    Note that adding characters to the regexp in an incremental regexp
  1074. search can make the cursor move back and start again.  For example, if
  1075. you have searched for `foo' and you add `\|bar', the cursor backs up in
  1076. case the first `bar' precedes the first `foo'.
  1077.  
  1078.    Nonincremental search for a regexp is done by the functions
  1079. `re-search-forward' and `re-search-backward'.  You can invoke these
  1080. with `M-x', or bind them to keys, or invoke them by way of incremental
  1081. regexp search with `C-M-s RET' and `C-M-r RET'.
  1082.  
  1083.